//
//  CustomBaseShowInTableViewCell.m
//  customer
//
//  Created by Holothurian on 2018/11/2.
//  Copyright © 2018年 yinlong. All rights reserved.
//

#import "CustomBaseShowInTableViewCell.h"

@implementation CustomBaseShowInTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _imgView = [[UIImageView alloc]init];
        _imgView.contentMode = UIViewContentModeScaleAspectFill;
        _imgView.layer.cornerRadius = 15;
        _imgView.layer.masksToBounds = YES;
        [self.contentView addSubview:_imgView];
        AutoWeakSelf
        [_imgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.mas_equalTo(UIEdgeInsetsMake(10, 15, 10, 15));
        }];
        
        
        _effectView = [[UIView alloc]init];
        _effectView.backgroundColor = [UIColor lightGrayColor];
        _effectView.alpha = 0.7;
        _effectView.layer.cornerRadius = 15;
        _effectView.layer.masksToBounds = YES;
        [self.contentView addSubview:_effectView];
        [_effectView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(weakSelf.imageView);
        }];
        
        _nameLabel = [[UILabel alloc]init];
        _nameLabel.textColor = [UIColor whiteColor];
        _nameLabel.font = Font(20);
        _nameLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_nameLabel];
        [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.center.equalTo(weakSelf.contentView);
            make.width.equalTo(weakSelf.imgView);
            make.height.mas_equalTo(30);
        }];
    }
    return self;
}

- (void)cellForCustomHouseTypeLayout:(CustomHouseTypeModel *)model{
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kCustomerImageIP,model.huxing_img]] placeholderImage:[UIImage imageNamed:@"globalPlaceholder"]];
    self.nameLabel.text = model.huxing_name;
}


- (void)cellForCustomCaseTypeLayout:(CustomCaseTypeModel *)model{
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kCustomerImageIP,model.programme_img]] placeholderImage:[UIImage imageNamed:@"globalPlaceholder"]];
    self.nameLabel.text = model.programme_name;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
